home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Resource for Source: C/C++
/
Resource for Source - C-C++.iso
/
codelib6
/
v_08_11
/
8n11088c
< prev
next >
Wrap
Text File
|
1995-11-01
|
561b
|
24 lines
class List {
public:
List() { head = 0; }
~List() {}
Truth isempty() { return head == 0; }
T get() { return head->value(); }
void add(T x) { /* as before */ }
T del() { /* as before */ }
private:
Node *head;
friend It; // It is still a friend of List
// tail returns the tail of the List. cdr in LISP.
List tail()
{
List r;
if( !isempty() )
r.head = head->next();
return r;
}
};